package com.tfswx.jcyw.dmzc.bean;

import java.awt.*;

/**
 * @author 张述江
 * @date 2023/5/30
 */
public class Gbc extends GridBagConstraints {
    /**
     * 此构造器gridwidth和gridheight使用默认值1
     **/
    public Gbc(int gridx, int gridy) {
        this(gridx, gridy, 1, 1);
    }

    public Gbc(int gridx, int gridy, int gridwidth, int gridheight) {
        this(gridx, gridy, gridwidth, gridheight, HORIZONTAL);
    }

    public Gbc(int gridx, int gridy, int gridwidth, int gridheight, int fill) {
        this.gridx = gridx - 1;
        this.gridy = gridy - 1;
        this.gridwidth = gridwidth;
        this.gridheight = gridheight;
        this.fill = fill;
    }

    //设置外边距
    public Gbc setInsets(int top, int left, int bottom, int right) {
        this.insets = new Insets(top, left, bottom, right);
        return this;
    }
}
